|
Eclipse Platform Pre-release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.text.FindReplaceDocumentAdapter
Adapts IDocument
for doing search and
replace operations.
Constructor Summary | |
FindReplaceDocumentAdapter(IDocument document)
Constructs a new find replace document adapter. |
Method Summary | |
char |
charAt(int index)
|
IRegion |
findReplace(FindReplaceOperationCode operationCode,
int startOffset,
String findString,
String replaceText,
boolean forwardSearch,
boolean caseSensitive,
boolean wholeWord,
boolean regExSearch)
Stateful findReplace executes a FIND, REPLACE, REPLACE_FIND or FIND_FIRST operation. |
int |
length()
|
IRegion |
replace(String text,
boolean regExReplace)
Subsitutes the previous match with the given text. |
IRegion |
search(int startOffset,
String findString,
boolean forwardSearch,
boolean caseSensitive,
boolean wholeWord,
boolean regExSearch)
Returns the region of a given search string in the document based on a set of search criteria. |
CharSequence |
subSequence(int start,
int end)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FindReplaceDocumentAdapter(IDocument document)
document
- the adapted documentMethod Detail |
public IRegion search(int startOffset, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord, boolean regExSearch) throws BadLocationException
startOffset
- document offset at which search startsfindString
- the string to findforwardSearch
- the search directioncaseSensitive
- indicates whether lower and upper case should be distinguishedwholeWord
- indicates whether the findString should be limited by white spaces as
defined by Character.isWhiteSpace. Must not be used in combination with regExSearch
.regExSearch
- if true
findString represents a regular expression
Must not be used in combination with regExSearch
.
null
if there was no match
BadLocationException
- if startOffset is an invalid document offset
PatternSyntaxException
- if a regular expression has invalid syntaxpublic IRegion findReplace(FindReplaceOperationCode operationCode, int startOffset, String findString, String replaceText, boolean forwardSearch, boolean caseSensitive, boolean wholeWord, boolean regExSearch) throws BadLocationException
DocumentEvent
to all
registered IDocumentListener
.
startOffset
- document offset at which search starts
this value is only used in the FIND_FIRST operation and otherwise ignoredfindString
- the string to find
this value is only used in the FIND_FIRST operation and otherwise ignoredforwardSearch
- the search directioncaseSensitive
- indicates whether lower and upper case should be distinguishedwholeWord
- indicates whether the findString should be limited by white spaces as
defined by Character.isWhiteSpace. Must not be used in combination with regExSearch
.regExSearch
- if true
this operation represents a regular expression
Must not be used in combination with wholeWord
.operationCode
- specifies what kind of operation is executed
null
if there was no match
BadLocationException
- if startOffset is an invalid document offset
IllegalStateException
- if a REPLACE or REPLACE_FIND operation is not preceded by a successful FIND operation
PatternSyntaxException
- if a regular expression has invalid syntaxFindReplaceOperationCode.FIND_FIRST
,
FindReplaceOperationCode.FIND_NEXT
,
FindReplaceOperationCode.REPLACE
,
FindReplaceOperationCode.REPLACE_FIND_NEXT
public IRegion replace(String text, boolean regExReplace) throws BadLocationException
DocumentEvent
to all registered IDocumentListener
.
text
- the substitution text
null
if there was no match
BadLocationException
- if startOffset is an invalid document offset
IllegalStateException
- if a REPLACE or REPLACE_FIND operation is not preceded by a successful FIND operation
PatternSyntaxException
- if a regular expression has invalid syntaxDocumentEvent
,
IDocumentListener
public int length()
length
in interface CharSequence
public char charAt(int index)
charAt
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public String toString()
toString
in interface CharSequence
|
Eclipse Platform Pre-release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |